package com.hqu.environment.controller.admin;

import com.alibaba.fastjson.JSONObject;
import com.hqu.environment.annotation.LoginUser;
import com.hqu.environment.dao.MonitorPlanDao;
import com.hqu.environment.dto.MonitorPlanDTO;
import com.hqu.environment.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;
import java.util.List;

/**
 * @Description: 农场Controller
 * @Date: 2019/04/25 22:15
 * @Author: 邓勇嘉
 **/
@Controller
@RequestMapping("admin/plan")
public class AdminPlanController {
    @Autowired
    MonitorPlanDao monitorPlanDao;


    @RequestMapping("/getList")
    @ResponseBody
    public Result getMonitorPlanList(MonitorPlanDTO monitorPlanDTO) {
        List<MonitorPlanDTO> monitorPlanList = monitorPlanDao.selectList(monitorPlanDTO);
        return Result.success().add("planList",monitorPlanList);
    }

    @RequestMapping("/getById")
    @ResponseBody
    public Result getMonitorPlanById(Integer id) {
        MonitorPlanDTO monitorPlanDTO = monitorPlanDao.selectByPrimaryKey(id);
        return Result.success().add("plan",monitorPlanDTO);
    }

}
